package com.cloudlibrary.mapper;

import com.cloudlibrary.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Controller;

/**
* @author lenove
* @description 针对表【user】的数据库操作Mapper
* @createDate 2024-12-12 14:03:08
* @Entity cloudlibrary.domain.User
*/

@Mapper
public interface UserMapper{
    @Select("SELECT * FROM user WHERE user_email = #{email} AND "+
        "user_password = #{password} AND user_status != '1'" )
    @Results(id = "userMap", value = {
            @Result(id = true, property = "id", column = "user_id"),
            @Result(property = "name", column = "user_name"),
            @Result(property = "password", column = "user_password"),
            @Result(property = "email", column = "user_email"),
            @Result(property = "role", column = "user_role"),
            @Result(property = "status", column = "user_status")
            }
    )
    User login(User user);
}




